package org.xi.structural.proxy.basic;

import org.xi.structural.proxy.basic.api.Image;
import org.xi.structural.proxy.basic.proxy.ProxyImage;

/**
 * 静态代理
 */
public class Main {

    public static void main(String[] args) {
        Image image1 = new ProxyImage("HiRes_10MB_Photo1");
        Image image2 = new ProxyImage("HiRes_10MB_Photo2");

        image1.displayImage(); // loading necessary
        image1.displayImage(); // loading unnecessary
        image2.displayImage(); // loading necessary
        image2.displayImage(); // loading unnecessary
        image1.displayImage(); // loading unnecessary
    }
}
